﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace Cityship
{
    static class SpriteSet
    {
        private static ContentManager _content;
        public static void Initialize(ContentManager content)
        {
            _content = content;
        }

        public static Dictionary<string, Texture2D> Floor;
        public static Dictionary<string, Texture2D> Wall;
        public static Dictionary<string, Texture2D> Entity;

        public static Dictionary<string, Texture2D> GetTileSet(TileType type)
        {
            switch (type)
            {
                case TileType.Floor:
                    return Floor;
                case TileType.Wall:
                    return Wall;
                case TileType.Nothing:
                    return null;
                default:
                    return null;
            }
        }

        public static void LoadContentItems()
        {

            #region Floor
            Floor = new Dictionary<string, Texture2D> { };
            Floor["plain"] = _content.Load<Texture2D>("tiles\\floorPlain");

            Floor["default"] = Floor["plain"]; //Default
            #endregion

            #region Wall
            Wall = new Dictionary<string, Texture2D> { };
            Wall["straight"] = _content.Load<Texture2D>("tiles\\wallStraight");
            Wall["column"] = _content.Load<Texture2D>("tiles\\wallColumn");
            Wall["cap"] = _content.Load<Texture2D>("tiles\\wallCap");
            Wall["corner"] = _content.Load<Texture2D>("tiles\\wallCorner");
            Wall["cross"] = _content.Load<Texture2D>("tiles\\wallCross");
            Wall["tri"] = _content.Load<Texture2D>("tiles\\wallTri");

            Wall["default"] = Wall["column"]; //Default
            #endregion

            #region Entity
            Entity = new Dictionary<string, Texture2D> { };
            Entity["basic"] = _content.Load<Texture2D>("entities\\basic");

            Entity["default"] = Entity["basic"]; //Default
            #endregion
        }
    }
}
